﻿using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Verify = AutoCADDotNetLibrary.AnalyzersTests.Common.CSharpAnalyzerVerifier<AutoCADDotNetLibrary.Analyzers.Analyzers.IExtensionApplicationAnalyzer>;

namespace AutoCADDotNetLibrary.AnalyzersTests.Analyzers
{
    [TestClass()]
    public class IExtensionApplicationAnalyzer
    {
        [TestMethod()]
        public async Task ExecuteTest()
        {
            string test = @"

using Autodesk.AutoCAD.Runtime;

namespace Test
{
    public class Init1 : IExtensionApplication
    {

        public void Initialize()
        {

        }

        public void Terminate()
        {

        }
    }

    public class Init2 : IExtensionApplication
    {

        public void Initialize()
        {

        }

        public void Terminate()
        {

        }
    }
}


";
            DiagnosticResult[] expected =
            {
                Verify.Diagnostic().WithSpan(7, 18, 7, 23).WithArguments("Test.Init1"),
                Verify.Diagnostic().WithSpan(21, 18, 21, 23).WithArguments("Test.Init2"),
            };

            await Verify.VerifyAnalyzerAsync(test, expected);
        }
    }
}
